Optimal. Leaf size=204 \[ \frac{a^5 \log (a+b \sin (c+d x))}{d \left (a^2-b^2\right )^3}-\frac{\left (8 a^2+9 a b+3 b^2\right ) \log (1-\sin (c+d x))}{16 d (a+b)^3}-\frac{\left (8 a^2-9 a b+3 b^2\right ) \log (\sin (c+d x)+1)}{16 d (a-b)^3}+\frac{\sec ^4(c+d x) (a-b \sin (c+d x))}{4 d \left (a^2-b^2\right )}-\frac{\sec ^2(c+d x) \left (4 a \left (2 a^2-b^2\right )-b \left (9 a^2-5 b^2\right ) \sin (c+d x)\right )}{8 d \left (a^2-b^2\right )^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.363019, antiderivative size = 204, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {2721, 1647, 801} \[ \frac{a^5 \log (a+b \sin (c+d x))}{d \left (a^2-b^2\right )^3}-\frac{\left (8 a^2+9 a b+3 b^2\right ) \log (1-\sin (c+d x))}{16 d (a+b)^3}-\frac{\left (8 a^2-9 a b+3 b^2\right ) \log (\sin (c+d x)+1)}{16 d (a-b)^3}+\frac{\sec ^4(c+d x) (a-b \sin (c+d x))}{4 d \left (a^2-b^2\right )}-\frac{\sec ^2(c+d x) \left (4 a \left (2 a^2-b^2\right )-b \left (9 a^2-5 b^2\right ) \sin (c+d x)\right )}{8 d \left (a^2-b^2\right )^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2721
Rule 1647
Rule 801
Rubi steps
\begin{align*} \int \frac{\tan ^5(c+d x)}{a+b \sin (c+d x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^5}{(a+x) \left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac{\sec ^4(c+d x) (a-b \sin (c+d x))}{4 \left (a^2-b^2\right ) d}+\frac{\operatorname{Subst}\left (\int \frac{\frac{a b^6}{a^2-b^2}-\frac{b^4 \left (4 a^2-b^2\right ) x}{a^2-b^2}-4 b^2 x^3}{(a+x) \left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 b^2 d}\\ &=\frac{\sec ^4(c+d x) (a-b \sin (c+d x))}{4 \left (a^2-b^2\right ) d}-\frac{\sec ^2(c+d x) \left (4 a \left (2 a^2-b^2\right )-b \left (9 a^2-5 b^2\right ) \sin (c+d x)\right )}{8 \left (a^2-b^2\right )^2 d}+\frac{\operatorname{Subst}\left (\int \frac{-\frac{a b^6 \left (7 a^2-3 b^2\right )}{\left (a^2-b^2\right )^2}+\frac{b^4 \left (8 a^4-7 a^2 b^2+3 b^4\right ) x}{\left (a^2-b^2\right )^2}}{(a+x) \left (b^2-x^2\right )} \, dx,x,b \sin (c+d x)\right )}{8 b^4 d}\\ &=\frac{\sec ^4(c+d x) (a-b \sin (c+d x))}{4 \left (a^2-b^2\right ) d}-\frac{\sec ^2(c+d x) \left (4 a \left (2 a^2-b^2\right )-b \left (9 a^2-5 b^2\right ) \sin (c+d x)\right )}{8 \left (a^2-b^2\right )^2 d}+\frac{\operatorname{Subst}\left (\int \left (\frac{b^4 \left (8 a^2+9 a b+3 b^2\right )}{2 (a+b)^3 (b-x)}+\frac{8 a^5 b^4}{(a-b)^3 (a+b)^3 (a+x)}+\frac{b^4 \left (8 a^2-9 a b+3 b^2\right )}{2 (-a+b)^3 (b+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{8 b^4 d}\\ &=-\frac{\left (8 a^2+9 a b+3 b^2\right ) \log (1-\sin (c+d x))}{16 (a+b)^3 d}-\frac{\left (8 a^2-9 a b+3 b^2\right ) \log (1+\sin (c+d x))}{16 (a-b)^3 d}+\frac{a^5 \log (a+b \sin (c+d x))}{\left (a^2-b^2\right )^3 d}+\frac{\sec ^4(c+d x) (a-b \sin (c+d x))}{4 \left (a^2-b^2\right ) d}-\frac{\sec ^2(c+d x) \left (4 a \left (2 a^2-b^2\right )-b \left (9 a^2-5 b^2\right ) \sin (c+d x)\right )}{8 \left (a^2-b^2\right )^2 d}\\ \end{align*}
Mathematica [A] time = 1.46175, size = 184, normalized size = 0.9 \[ \frac{-\frac{\left (8 a^2+9 a b+3 b^2\right ) \log (1-\sin (c+d x))}{(a+b)^3}-\frac{\left (8 a^2-9 a b+3 b^2\right ) \log (\sin (c+d x)+1)}{(a-b)^3}+\frac{16 a^5 \log (a+b \sin (c+d x))}{(a-b)^3 (a+b)^3}+\frac{7 a+5 b}{(a+b)^2 (\sin (c+d x)-1)}+\frac{5 b-7 a}{(a-b)^2 (\sin (c+d x)+1)}+\frac{1}{(a+b) (\sin (c+d x)-1)^2}+\frac{1}{(a-b) (\sin (c+d x)+1)^2}}{16 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.066, size = 304, normalized size = 1.5 \begin{align*}{\frac{{a}^{5}\ln \left ( a+b\sin \left ( dx+c \right ) \right ) }{d \left ( a+b \right ) ^{3} \left ( a-b \right ) ^{3}}}+{\frac{1}{2\,d \left ( 8\,a+8\,b \right ) \left ( \sin \left ( dx+c \right ) -1 \right ) ^{2}}}+{\frac{7\,a}{16\,d \left ( a+b \right ) ^{2} \left ( \sin \left ( dx+c \right ) -1 \right ) }}+{\frac{5\,b}{16\,d \left ( a+b \right ) ^{2} \left ( \sin \left ( dx+c \right ) -1 \right ) }}-{\frac{\ln \left ( \sin \left ( dx+c \right ) -1 \right ){a}^{2}}{2\,d \left ( a+b \right ) ^{3}}}-{\frac{9\,\ln \left ( \sin \left ( dx+c \right ) -1 \right ) ab}{16\,d \left ( a+b \right ) ^{3}}}-{\frac{3\,\ln \left ( \sin \left ( dx+c \right ) -1 \right ){b}^{2}}{16\,d \left ( a+b \right ) ^{3}}}+{\frac{1}{2\,d \left ( 8\,a-8\,b \right ) \left ( 1+\sin \left ( dx+c \right ) \right ) ^{2}}}-{\frac{7\,a}{16\,d \left ( a-b \right ) ^{2} \left ( 1+\sin \left ( dx+c \right ) \right ) }}+{\frac{5\,b}{16\,d \left ( a-b \right ) ^{2} \left ( 1+\sin \left ( dx+c \right ) \right ) }}-{\frac{\ln \left ( 1+\sin \left ( dx+c \right ) \right ){a}^{2}}{2\,d \left ( a-b \right ) ^{3}}}+{\frac{9\,\ln \left ( 1+\sin \left ( dx+c \right ) \right ) ab}{16\,d \left ( a-b \right ) ^{3}}}-{\frac{3\,\ln \left ( 1+\sin \left ( dx+c \right ) \right ){b}^{2}}{16\,d \left ( a-b \right ) ^{3}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.8256, size = 389, normalized size = 1.91 \begin{align*} \frac{\frac{16 \, a^{5} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}} - \frac{{\left (8 \, a^{2} - 9 \, a b + 3 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}} - \frac{{\left (8 \, a^{2} + 9 \, a b + 3 \, b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right )}{a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}} - \frac{2 \,{\left ({\left (9 \, a^{2} b - 5 \, b^{3}\right )} \sin \left (d x + c\right )^{3} + 6 \, a^{3} - 2 \, a b^{2} - 4 \,{\left (2 \, a^{3} - a b^{2}\right )} \sin \left (d x + c\right )^{2} -{\left (7 \, a^{2} b - 3 \, b^{3}\right )} \sin \left (d x + c\right )\right )}}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sin \left (d x + c\right )^{4} + a^{4} - 2 \, a^{2} b^{2} + b^{4} - 2 \,{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sin \left (d x + c\right )^{2}}}{16 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.47436, size = 594, normalized size = 2.91 \begin{align*} \frac{16 \, a^{5} \cos \left (d x + c\right )^{4} \log \left (b \sin \left (d x + c\right ) + a\right ) -{\left (8 \, a^{5} + 15 \, a^{4} b - 10 \, a^{2} b^{3} + 3 \, b^{5}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) -{\left (8 \, a^{5} - 15 \, a^{4} b + 10 \, a^{2} b^{3} - 3 \, b^{5}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 4 \, a^{5} - 8 \, a^{3} b^{2} + 4 \, a b^{4} - 8 \,{\left (2 \, a^{5} - 3 \, a^{3} b^{2} + a b^{4}\right )} \cos \left (d x + c\right )^{2} - 2 \,{\left (2 \, a^{4} b - 4 \, a^{2} b^{3} + 2 \, b^{5} -{\left (9 \, a^{4} b - 14 \, a^{2} b^{3} + 5 \, b^{5}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{16 \,{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} d \cos \left (d x + c\right )^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tan ^{5}{\left (c + d x \right )}}{a + b \sin{\left (c + d x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 5.11783, size = 463, normalized size = 2.27 \begin{align*} \frac{\frac{16 \, a^{5} b \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{6} b - 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} - b^{7}} - \frac{{\left (8 \, a^{2} - 9 \, a b + 3 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}} - \frac{{\left (8 \, a^{2} + 9 \, a b + 3 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}} + \frac{2 \,{\left (6 \, a^{5} \sin \left (d x + c\right )^{4} - 9 \, a^{4} b \sin \left (d x + c\right )^{3} + 14 \, a^{2} b^{3} \sin \left (d x + c\right )^{3} - 5 \, b^{5} \sin \left (d x + c\right )^{3} - 4 \, a^{5} \sin \left (d x + c\right )^{2} - 12 \, a^{3} b^{2} \sin \left (d x + c\right )^{2} + 4 \, a b^{4} \sin \left (d x + c\right )^{2} + 7 \, a^{4} b \sin \left (d x + c\right ) - 10 \, a^{2} b^{3} \sin \left (d x + c\right ) + 3 \, b^{5} \sin \left (d x + c\right ) + 8 \, a^{3} b^{2} - 2 \, a b^{4}\right )}}{{\left (a^{6} - 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )}{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2}}}{16 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]